package com.zretc.service.impl;

import java.util.Map;

import com.zretc.dao.SingerDao;
import com.zretc.dao.impl.SingerDaoImpl;
import com.zretc.entity.Singer;
import com.zretc.service.SingerService;
import com.zretc.util.PageInfo;

/**
 * 歌手服务层实现类
 * @author Administrator
 *
 */
public class SingerServiceImpl implements SingerService {
	private SingerDao singerDao = new SingerDaoImpl();
	@Override
	public PageInfo<Singer> getSingerBySingerId(Map<String, String> map) {
		
		return singerDao.findSingerBySingerId(map);
	}
	@Override
	public PageInfo<Singer> getSingerByComdition(Map<String, String> map) {
		String areaName = map.get("areaName");
		String gender = map.get("gender");
		if ("全部".equals(areaName)) {
			map.put("areaName", "%"+""+"%");
		}else {
			map.put("areaName", "%"+areaName+"%");
		}
		if ("全部".equals(gender)) {
			map.put("gender", "%"+""+"%");
		}else {
			map.put("gender", "%"+gender+"%");
		}
		
		PageInfo<Singer> findSingerByComdition = singerDao.findSingerByComdition(map);
		return findSingerByComdition;
	}

}
